home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 1997 #1 / Amiga Plus CD - 1997 - No. 01.iso / pd / daten / easycalc / easyrexx / shownegative.erex < prev    next >
Text File  |  1986-06-08  |  519b  |  28 lines

  1. /* script to change all negative numbers into RED */
  2.  
  3. options results
  4.  
  5. setpalette 3 15 0 0 /* make colour 3 red */
  6.  
  7. getsheetwidth   /* find out the worksheet dimensions */
  8. maxcol = result
  9.  
  10. getsheetheight
  11. maxrow = result
  12.  
  13. do x = 0 for maxcol+1   /* loop through every cell */
  14.  
  15.   do y = 0 for maxrow+1
  16.   
  17.     getcelltype x y
  18.  
  19.     if result ~= "STRING" then /* skip any string cell */
  20.     do
  21.       getcellvalue x y
  22.       if result < 0 then setcolour x y 3 /* less than 0? then set the colour to red */
  23.     end
  24.  
  25.   end
  26. end
  27.  
  28.